package com.innerclass.demo4;

public class Parcel5 {

	public Destination destination(String s) {
		// 在方法的作用域内创建一个完整的类，叫做局部内部类
		class IDestination implements Destination {

			private String label;

			public IDestination(String whereTo) {
				label = whereTo;
			}

			@Override
			public String readLable() {
				System.out.println(label);
				return label;
			}

		}

		return new IDestination(s);
	}

	public static void main(String[] args) {
		Parcel5 parcel5 = new Parcel5();
		Destination destination = parcel5.destination("abccc");
		destination.readLable();
	}

}
